<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加样式</title>
    <style>
        h1{
            color: red;
            background: lightblue;
            text-align: center;
        }
        #test{
            color: white;
            background: black;
        }
        .className{
            color: blue;
            background: black;
        }
    </style>
</head>
<body>
    <h1 class="className">Lorem ipsum dolor sit amet.</h1>
    <h1 id="test">Lorem ipsum dolor sit amet.</h1>
    <h1 class="className">Lorem ipsum dolor sit amet.</h1>
    <p style="color:black;background: blue">Lorem ipsum dolor sit amet consectetur.</p>
</body>
</html>